﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Forget.HRBLL.Logical;

namespace HRWebSite.User
{
    public partial class EditPassWord : BasePage
    {       
        protected override void Page_Load(object sender, EventArgs e)
        {
            this.HRLimitAttribute = Forget.HRBLL.LimitAttribute.Read | Forget.HRBLL.LimitAttribute.Modify;
            this.HRLimits = Limits.UserInfo;
            this.Page.Title = "修改密码";
            base.Page_Load(sender, e);
            this.TextBox1.Text = this.HRUser.UserName;
        }      

        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            if (this.TextBox3.Text == this.TextBox4.Text)
            {
                if (!UserLogical.ModifyPassword(this.HRUser.NumberID, this.HRUser.UserName, this.TextBox3.Text))
                    this.literal1.Text = "<span style=\"color: #FF0000\">系统出现故障，请等待或与管理员联系！</span>";
                else
                    this.literal1.Text = "<span style=\"color: #FF0000\">修改成功</span>";
            }
            else
                this.literal1.Text = "<span style=\"color: #FF0000\">两次输入的密码必须相同</span>";
        }
    }
}